package com.newasia.management.controller;/**
 * Created by mic on 2019/8/1.
 */

import com.newasia.commons.result.ResponseData;
import com.newasia.commons.result.ResponseUtil;
import com.newasia.management.IManagementItemsService;
import com.newasia.management.constants.ManagementRetCode;
import com.newasia.management.dto.productSku.*;
import com.newasia.management.dto.productSkuPerm.ChangeSkuPermRequest;
import com.newasia.management.dto.productSkuPerm.ChangeSkuPermResponse;
import com.newasia.management.dto.productSpu.*;
import com.newasia.search.InitDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * 腾讯课堂搜索【咕泡学院】
 * 官网：www.gupaoedu.com
 * 风骚的Mic 老师
 * create-date: 2019/8/1-下午5:27
 */
@Slf4j
@RestController
@RequestMapping("/management")
public class SearchController {

    @Reference(timeout = 3000)
    private InitDataService initDataService;

    @GetMapping("/search/init")
    public ResponseData init(){
        initDataService.initItems();
        return new ResponseUtil().setData(null);
    }

    @GetMapping("/search/delete")
    public ResponseData delete(){
        initDataService.deleteItem();
        return new ResponseUtil().setData(null);
    }
}
